3.448 \(\int \frac{(a+a \sin (e+f x))^3}{c+d \sin (e+f x)} \, dx\)

Optimal. Leaf size=143 \[ -\frac{2 a^3 (c-d)^3 \tan ^{-1}\left (\frac{c \tan \left (\frac{1}{2} (e+f x)\right )+d}{\sqrt{c^2-d^2}}\right )}{d^3 f \sqrt{c^2-d^2}}+\frac{a^3 x \left (2 c^2-6 c d+7 d^2\right )}{2 d^3}+\frac{a^3 (2 c-5 d) \cos (e+f x)}{2 d^2 f}-\frac{\cos (e+f x) \left (a^3 \sin (e+f x)+a^3\right )}{2 d f} \]

[Out]

(a^3*(2*c^2 - 6*c*d + 7*d^2)*x)/(2*d^3) - (2*a^3*(c - d)^3*ArcTan[(d + c*Tan[(e + f*x)/2])/Sqrt[c^2 - d^2]])/(
d^3*Sqrt[c^2 - d^2]*f) + (a^3*(2*c - 5*d)*Cos[e + f*x])/(2*d^2*f) - (Cos[e + f*x]*(a^3 + a^3*Sin[e + f*x]))/(2
*d*f)

________________________________________________________________________________________

Rubi [A]  time = 0.38868, antiderivative size = 143, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 7, integrand size = 25, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.28, Rules used = {2763, 2968, 3023, 2735, 2660, 618, 204} \[ -\frac{2 a^3 (c-d)^3 \tan ^{-1}\left (\frac{c \tan \left (\frac{1}{2} (e+f x)\right )+d}{\sqrt{c^2-d^2}}\right )}{d^3 f \sqrt{c^2-d^2}}+\frac{a^3 x \left (2 c^2-6 c d+7 d^2\right )}{2 d^3}+\frac{a^3 (2 c-5 d) \cos (e+f x)}{2 d^2 f}-\frac{\cos (e+f x) \left (a^3 \sin (e+f x)+a^3\right )}{2 d f} \]

Antiderivative was successfully verified.

[In]

Int[(a + a*Sin[e + f*x])^3/(c + d*Sin[e + f*x]),x]

[Out]

(a^3*(2*c^2 - 6*c*d + 7*d^2)*x)/(2*d^3) - (2*a^3*(c - d)^3*ArcTan[(d + c*Tan[(e + f*x)/2])/Sqrt[c^2 - d^2]])/(
d^3*Sqrt[c^2 - d^2]*f) + (a^3*(2*c - 5*d)*Cos[e + f*x])/(2*d^2*f) - (Cos[e + f*x]*(a^3 + a^3*Sin[e + f*x]))/(2
*d*f)

Rule 2763

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> -Si
mp[(b^2*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m - 2)*(c + d*Sin[e + f*x])^(n + 1))/(d*f*(m + n)), x] + Dist[1/(d*
(m + n)), Int[(a + b*Sin[e + f*x])^(m - 2)*(c + d*Sin[e + f*x])^n*Simp[a*b*c*(m - 2) + b^2*d*(n + 1) + a^2*d*(
m + n) - b*(b*c*(m - 1) - a*d*(3*m + 2*n - 2))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] &&
NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 1] &&  !LtQ[n, -1] && (IntegersQ[2*m, 2*
n] || IntegerQ[m + 1/2] || (IntegerQ[m] && EqQ[c, 0]))

Rule 2968

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(
e_.) + (f_.)*(x_)]), x_Symbol] :> Int[(a + b*Sin[e + f*x])^m*(A*c + (B*c + A*d)*Sin[e + f*x] + B*d*Sin[e + f*x
]^2), x] /; FreeQ[{a, b, c, d, e, f, A, B, m}, x] && NeQ[b*c - a*d, 0]

Rule 3023

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> -Simp[(C*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1))/(b*f*(m + 2)), x] + Dist[1/(b*
(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x], x]
, x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 2660

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x]}, Dis
t[(2*e)/d, Subst[Int[1/(a + 2*b*e*x + a*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] &&
 NeQ[a^2 - b^2, 0]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \frac{(a+a \sin (e+f x))^3}{c+d \sin (e+f x)} \, dx &=-\frac{\cos (e+f x) \left (a^3+a^3 \sin (e+f x)\right )}{2 d f}+\frac{\int \frac{(a+a \sin (e+f x)) \left (a^2 (c+2 d)-a^2 (2 c-5 d) \sin (e+f x)\right )}{c+d \sin (e+f x)} \, dx}{2 d}\\ &=-\frac{\cos (e+f x) \left (a^3+a^3 \sin (e+f x)\right )}{2 d f}+\frac{\int \frac{a^3 (c+2 d)+\left (-a^3 (2 c-5 d)+a^3 (c+2 d)\right ) \sin (e+f x)-a^3 (2 c-5 d) \sin ^2(e+f x)}{c+d \sin (e+f x)} \, dx}{2 d}\\ &=\frac{a^3 (2 c-5 d) \cos (e+f x)}{2 d^2 f}-\frac{\cos (e+f x) \left (a^3+a^3 \sin (e+f x)\right )}{2 d f}+\frac{\int \frac{a^3 d (c+2 d)+a^3 \left (2 c^2-6 c d+7 d^2\right ) \sin (e+f x)}{c+d \sin (e+f x)} \, dx}{2 d^2}\\ &=\frac{a^3 \left (2 c^2-6 c d+7 d^2\right ) x}{2 d^3}+\frac{a^3 (2 c-5 d) \cos (e+f x)}{2 d^2 f}-\frac{\cos (e+f x) \left (a^3+a^3 \sin (e+f x)\right )}{2 d f}-\frac{\left (a^3 (c-d)^3\right ) \int \frac{1}{c+d \sin (e+f x)} \, dx}{d^3}\\ &=\frac{a^3 \left (2 c^2-6 c d+7 d^2\right ) x}{2 d^3}+\frac{a^3 (2 c-5 d) \cos (e+f x)}{2 d^2 f}-\frac{\cos (e+f x) \left (a^3+a^3 \sin (e+f x)\right )}{2 d f}-\frac{\left (2 a^3 (c-d)^3\right ) \operatorname{Subst}\left (\int \frac{1}{c+2 d x+c x^2} \, dx,x,\tan \left (\frac{1}{2} (e+f x)\right )\right )}{d^3 f}\\ &=\frac{a^3 \left (2 c^2-6 c d+7 d^2\right ) x}{2 d^3}+\frac{a^3 (2 c-5 d) \cos (e+f x)}{2 d^2 f}-\frac{\cos (e+f x) \left (a^3+a^3 \sin (e+f x)\right )}{2 d f}+\frac{\left (4 a^3 (c-d)^3\right ) \operatorname{Subst}\left (\int \frac{1}{-4 \left (c^2-d^2\right )-x^2} \, dx,x,2 d+2 c \tan \left (\frac{1}{2} (e+f x)\right )\right )}{d^3 f}\\ &=\frac{a^3 \left (2 c^2-6 c d+7 d^2\right ) x}{2 d^3}-\frac{2 a^3 (c-d)^3 \tan ^{-1}\left (\frac{d+c \tan \left (\frac{1}{2} (e+f x)\right )}{\sqrt{c^2-d^2}}\right )}{d^3 \sqrt{c^2-d^2} f}+\frac{a^3 (2 c-5 d) \cos (e+f x)}{2 d^2 f}-\frac{\cos (e+f x) \left (a^3+a^3 \sin (e+f x)\right )}{2 d f}\\ \end{align*}

Mathematica [A]  time = 0.650172, size = 162, normalized size = 1.13 \[ \frac{a^3 (\sin (e+f x)+1)^3 \left (\sqrt{c^2-d^2} \left (2 \left (2 c^2-6 c d+7 d^2\right ) (e+f x)+4 d (c-3 d) \cos (e+f x)+d^2 (-\sin (2 (e+f x)))\right )-8 (c-d)^3 \tan ^{-1}\left (\frac{c \tan \left (\frac{1}{2} (e+f x)\right )+d}{\sqrt{c^2-d^2}}\right )\right )}{4 d^3 f \sqrt{c^2-d^2} \left (\sin \left (\frac{1}{2} (e+f x)\right )+\cos \left (\frac{1}{2} (e+f x)\right )\right )^6} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + a*Sin[e + f*x])^3/(c + d*Sin[e + f*x]),x]

[Out]

(a^3*(1 + Sin[e + f*x])^3*(-8*(c - d)^3*ArcTan[(d + c*Tan[(e + f*x)/2])/Sqrt[c^2 - d^2]] + Sqrt[c^2 - d^2]*(2*
(2*c^2 - 6*c*d + 7*d^2)*(e + f*x) + 4*(c - 3*d)*d*Cos[e + f*x] - d^2*Sin[2*(e + f*x)])))/(4*d^3*Sqrt[c^2 - d^2
]*f*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])^6)

________________________________________________________________________________________

Maple [B]  time = 0.101, size = 480, normalized size = 3.4 \begin{align*} -2\,{\frac{{a}^{3}{c}^{3}}{f{d}^{3}\sqrt{{c}^{2}-{d}^{2}}}\arctan \left ( 1/2\,{\frac{2\,c\tan \left ( 1/2\,fx+e/2 \right ) +2\,d}{\sqrt{{c}^{2}-{d}^{2}}}} \right ) }+6\,{\frac{{a}^{3}{c}^{2}}{f{d}^{2}\sqrt{{c}^{2}-{d}^{2}}}\arctan \left ( 1/2\,{\frac{2\,c\tan \left ( 1/2\,fx+e/2 \right ) +2\,d}{\sqrt{{c}^{2}-{d}^{2}}}} \right ) }-6\,{\frac{{a}^{3}c}{df\sqrt{{c}^{2}-{d}^{2}}}\arctan \left ( 1/2\,{\frac{2\,c\tan \left ( 1/2\,fx+e/2 \right ) +2\,d}{\sqrt{{c}^{2}-{d}^{2}}}} \right ) }+2\,{\frac{{a}^{3}}{f\sqrt{{c}^{2}-{d}^{2}}}\arctan \left ( 1/2\,{\frac{2\,c\tan \left ( 1/2\,fx+e/2 \right ) +2\,d}{\sqrt{{c}^{2}-{d}^{2}}}} \right ) }+{\frac{{a}^{3}}{df} \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) \right ) ^{3} \left ( 1+ \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) \right ) ^{2} \right ) ^{-2}}+2\,{\frac{{a}^{3} \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}c}{f{d}^{2} \left ( 1+ \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2} \right ) ^{2}}}-6\,{\frac{{a}^{3} \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2}}{df \left ( 1+ \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2} \right ) ^{2}}}-{\frac{{a}^{3}}{df}\tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) \left ( 1+ \left ( \tan \left ({\frac{fx}{2}}+{\frac{e}{2}} \right ) \right ) ^{2} \right ) ^{-2}}+2\,{\frac{{a}^{3}c}{f{d}^{2} \left ( 1+ \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2} \right ) ^{2}}}-6\,{\frac{{a}^{3}}{df \left ( 1+ \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) ^{2} \right ) ^{2}}}+2\,{\frac{{a}^{3}\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ){c}^{2}}{f{d}^{3}}}-6\,{\frac{{a}^{3}\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) c}{f{d}^{2}}}+7\,{\frac{{a}^{3}\arctan \left ( \tan \left ( 1/2\,fx+e/2 \right ) \right ) }{df}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sin(f*x+e))^3/(c+d*sin(f*x+e)),x)

[Out]

-2/f*a^3/d^3/(c^2-d^2)^(1/2)*arctan(1/2*(2*c*tan(1/2*f*x+1/2*e)+2*d)/(c^2-d^2)^(1/2))*c^3+6/f*a^3/d^2/(c^2-d^2
)^(1/2)*arctan(1/2*(2*c*tan(1/2*f*x+1/2*e)+2*d)/(c^2-d^2)^(1/2))*c^2-6/f*a^3/d/(c^2-d^2)^(1/2)*arctan(1/2*(2*c
*tan(1/2*f*x+1/2*e)+2*d)/(c^2-d^2)^(1/2))*c+2/f*a^3/(c^2-d^2)^(1/2)*arctan(1/2*(2*c*tan(1/2*f*x+1/2*e)+2*d)/(c
^2-d^2)^(1/2))+1/f*a^3/d/(1+tan(1/2*f*x+1/2*e)^2)^2*tan(1/2*f*x+1/2*e)^3+2/f*a^3/d^2/(1+tan(1/2*f*x+1/2*e)^2)^
2*tan(1/2*f*x+1/2*e)^2*c-6/f*a^3/d/(1+tan(1/2*f*x+1/2*e)^2)^2*tan(1/2*f*x+1/2*e)^2-1/f*a^3/d/(1+tan(1/2*f*x+1/
2*e)^2)^2*tan(1/2*f*x+1/2*e)+2/f*a^3/d^2/(1+tan(1/2*f*x+1/2*e)^2)^2*c-6/f*a^3/d/(1+tan(1/2*f*x+1/2*e)^2)^2+2/f
*a^3/d^3*arctan(tan(1/2*f*x+1/2*e))*c^2-6/f*a^3/d^2*arctan(tan(1/2*f*x+1/2*e))*c+7/f*a^3/d*arctan(tan(1/2*f*x+
1/2*e))

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))^3/(c+d*sin(f*x+e)),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 2.21524, size = 909, normalized size = 6.36 \begin{align*} \left [-\frac{a^{3} d^{2} \cos \left (f x + e\right ) \sin \left (f x + e\right ) -{\left (2 \, a^{3} c^{2} - 6 \, a^{3} c d + 7 \, a^{3} d^{2}\right )} f x -{\left (a^{3} c^{2} - 2 \, a^{3} c d + a^{3} d^{2}\right )} \sqrt{-\frac{c - d}{c + d}} \log \left (\frac{{\left (2 \, c^{2} - d^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2} + 2 \,{\left ({\left (c^{2} + c d\right )} \cos \left (f x + e\right ) \sin \left (f x + e\right ) +{\left (c d + d^{2}\right )} \cos \left (f x + e\right )\right )} \sqrt{-\frac{c - d}{c + d}}}{d^{2} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2}}\right ) - 2 \,{\left (a^{3} c d - 3 \, a^{3} d^{2}\right )} \cos \left (f x + e\right )}{2 \, d^{3} f}, -\frac{a^{3} d^{2} \cos \left (f x + e\right ) \sin \left (f x + e\right ) -{\left (2 \, a^{3} c^{2} - 6 \, a^{3} c d + 7 \, a^{3} d^{2}\right )} f x - 2 \,{\left (a^{3} c^{2} - 2 \, a^{3} c d + a^{3} d^{2}\right )} \sqrt{\frac{c - d}{c + d}} \arctan \left (-\frac{{\left (c \sin \left (f x + e\right ) + d\right )} \sqrt{\frac{c - d}{c + d}}}{{\left (c - d\right )} \cos \left (f x + e\right )}\right ) - 2 \,{\left (a^{3} c d - 3 \, a^{3} d^{2}\right )} \cos \left (f x + e\right )}{2 \, d^{3} f}\right ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))^3/(c+d*sin(f*x+e)),x, algorithm="fricas")

[Out]

[-1/2*(a^3*d^2*cos(f*x + e)*sin(f*x + e) - (2*a^3*c^2 - 6*a^3*c*d + 7*a^3*d^2)*f*x - (a^3*c^2 - 2*a^3*c*d + a^
3*d^2)*sqrt(-(c - d)/(c + d))*log(((2*c^2 - d^2)*cos(f*x + e)^2 - 2*c*d*sin(f*x + e) - c^2 - d^2 + 2*((c^2 + c
*d)*cos(f*x + e)*sin(f*x + e) + (c*d + d^2)*cos(f*x + e))*sqrt(-(c - d)/(c + d)))/(d^2*cos(f*x + e)^2 - 2*c*d*
sin(f*x + e) - c^2 - d^2)) - 2*(a^3*c*d - 3*a^3*d^2)*cos(f*x + e))/(d^3*f), -1/2*(a^3*d^2*cos(f*x + e)*sin(f*x
 + e) - (2*a^3*c^2 - 6*a^3*c*d + 7*a^3*d^2)*f*x - 2*(a^3*c^2 - 2*a^3*c*d + a^3*d^2)*sqrt((c - d)/(c + d))*arct
an(-(c*sin(f*x + e) + d)*sqrt((c - d)/(c + d))/((c - d)*cos(f*x + e))) - 2*(a^3*c*d - 3*a^3*d^2)*cos(f*x + e))
/(d^3*f)]

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))**3/(c+d*sin(f*x+e)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.32861, size = 323, normalized size = 2.26 \begin{align*} \frac{\frac{{\left (2 \, a^{3} c^{2} - 6 \, a^{3} c d + 7 \, a^{3} d^{2}\right )}{\left (f x + e\right )}}{d^{3}} - \frac{4 \,{\left (a^{3} c^{3} - 3 \, a^{3} c^{2} d + 3 \, a^{3} c d^{2} - a^{3} d^{3}\right )}{\left (\pi \left \lfloor \frac{f x + e}{2 \, \pi } + \frac{1}{2} \right \rfloor \mathrm{sgn}\left (c\right ) + \arctan \left (\frac{c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + d}{\sqrt{c^{2} - d^{2}}}\right )\right )}}{\sqrt{c^{2} - d^{2}} d^{3}} + \frac{2 \,{\left (a^{3} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{3} + 2 \, a^{3} c \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - 6 \, a^{3} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} - a^{3} d \tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right ) + 2 \, a^{3} c - 6 \, a^{3} d\right )}}{{\left (\tan \left (\frac{1}{2} \, f x + \frac{1}{2} \, e\right )^{2} + 1\right )}^{2} d^{2}}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sin(f*x+e))^3/(c+d*sin(f*x+e)),x, algorithm="giac")

[Out]

1/2*((2*a^3*c^2 - 6*a^3*c*d + 7*a^3*d^2)*(f*x + e)/d^3 - 4*(a^3*c^3 - 3*a^3*c^2*d + 3*a^3*c*d^2 - a^3*d^3)*(pi
*floor(1/2*(f*x + e)/pi + 1/2)*sgn(c) + arctan((c*tan(1/2*f*x + 1/2*e) + d)/sqrt(c^2 - d^2)))/(sqrt(c^2 - d^2)
*d^3) + 2*(a^3*d*tan(1/2*f*x + 1/2*e)^3 + 2*a^3*c*tan(1/2*f*x + 1/2*e)^2 - 6*a^3*d*tan(1/2*f*x + 1/2*e)^2 - a^
3*d*tan(1/2*f*x + 1/2*e) + 2*a^3*c - 6*a^3*d)/((tan(1/2*f*x + 1/2*e)^2 + 1)^2*d^2))/f